package com.hsgene.order.service.api;

import com.hsgene.common.util.result.ApiResult;
import com.hsgene.dict.dto.SysDictDto;
import com.hsgene.order.service.api.impl.DictServiceImpl;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;

/**
 * @desc:字典
 * @author: fuxiang
 * @date: 2018/9/25 15:23
 */
@FeignClient(value = "ms-mod-dict", path = "/v1.0/genetic/testing/dict", fallback = DictServiceImpl.class)
public interface DictService {


    /**
     * 字典列表
     *
     * @param type      字典类型
     * @param rangeType all
     * @return
     */
    @GetMapping("")
    ApiResult<List<SysDictDto>> sysDicts(
            @RequestParam(name = "type", required = false) String type,
            @RequestParam(name = "range_type", required = false) String rangeType);

    /***
     * 根据字典名称查询所有字典
     * @author jcl
     * @date 2018/12/4 15:58
     * @param dictAddtionId 字典名称的id
     * @return
     */
    @GetMapping("select/value/{dict_addtion_id}")
    ApiResult<List<SysDictDto>> valueByDictAddtionId(@PathVariable(name = "dict_addtion_id") String dictAddtionId);

    /***
     * 根据字典id获取信息
     * @author jcl
     * @date 2018/12/11 15:23
     * @param id
     * @return
     */
    @GetMapping("{id}")
    ApiResult<SysDictDto> sysDict(@PathVariable("id") String id);
}
